using System;
using System.IO;
using System.Windows;
using System.Net;
using Qplus.beans;

namespace Qplus.Commands
{

    /**
     * 
     *
     */
    public class GetFileCommand : AbsHeaderHttpCommand , HttpInputStreamProcessor{

	    const String COMMAND = "GetFile";

	    Session session;
	    String filepath;
	    long id;
	    int retry = 1;
	    /**
	     * @param uid
	     * @param UKEY
	     */
	    public GetFileCommand(String uid, String UKEY, Session session, long id, String filepath) 
            : base(COMMAND, uid, UKEY)
        {
		    this.session = session;
		    this.id = id;
		    this.filepath = filepath;
	    }
	
	    public void set(String resid){
		    setResID(resid);
	    }

	    private void setResID(String resID){
		    addParams("FileID", resID);
	    }
	    
	    public override Boolean processInputStream(Stream responseStream) {
		    
		    return true;
	    }

        public override Boolean processHeader(WebHeaderCollection Header)
        {
		    return true;
	    }

	    
	    public override void onSuccess(int code) {
	    }

	    
	    public override void onFailed(int code) {
		   
	    }

	    public HttpTask execute(String url) {
		    return base.execute(url, this);
	    }
    }
}
